/*
 * Copyright (C) 2010-2012 Susanta Tewari
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package genomemap.cef.pui;

import cef.event.Event;
import cef.pui.EventConstructionException;
import cef.pui.EventImpl;
import cef.pui.pob.Builder;
import cef.pui.pob.BuilderException;
import genomemap.cef.event.DrawContigMap_Evt;
import genomemap.cef.pui.pob.Builders_Gen;
import genomemap.data.KSA00Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

/**
 * Implements {@code ComputeKSA00Likelihood_Evt} using the following properties. <ul> <li>{@code
 * genomemap.builder.KSA00Data.url = ksa00data:xml//URL }<a href="genomemap/cef/pui/pob/doc-files/ksa00-data.xml.txt">file
 * format</a>, must accompany the <a href="genomemap/cef/pui/pob/doc-files/KSA00Data.xsd.txt">schema</a></li>
 * <li>{@code genomemap.ContigMapType.format = FULL | MINIMAL}</li></ul>
 *
 * @author Susanta Tewari
 * @history Created on Sep 5, 2012.
 */
public final class DrawContigMap_EvtImpl extends EventImpl implements DrawContigMap_Evt {

    /** Field description */
    private final Builder<KSA00Data> dataBuilder;


    // contig type builder

    /** Field description */
    private final Builder<ContigMapType> contigMapTypeBuilder;

    /**
     * Constructs ...
     *
     *
     * @param props
     *
     * @throws EventConstructionException
     */
    public DrawContigMap_EvtImpl(final Properties props) throws EventConstructionException {

        super(props);

        super.processEventProperties(getImplementedEventInterfaces());


        // data builder
        dataBuilder = Builders_Gen.of_Data_KSA00_File(props, null);


        //
        contigMapTypeBuilder = Builders_Gen.of_ContigMapType(props, null);
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    protected List<Class<? extends Event>> getImplementedEventInterfaces() {

        final List<Class<? extends cef.event.Event>> result = new ArrayList<>(2);

        result.add(DrawContigMap_Evt.class);
        result.add(Event.class);

        return result;
    }

    /**
     * {@inheritDoc}
     *
     * @throws cef.pui.pob.BuilderException
     */
    @Override
    public KSA00Data getData() throws BuilderException {
        return dataBuilder.build();
    }

    /**
     * {@inheritDoc}
     *
     * @throws cef.pui.pob.BuilderException
     */
    @Override
    public ContigMapType getContigMapType() throws BuilderException {
        return contigMapTypeBuilder.build();
    }
}
